package com.zhanghp.demo02.state;

import com.zhanghp.demo02.IPlayer;
import com.zhanghp.demo02.IState;

/**
 * @author zhanghp
 * @date 2022-09-05 13:56
 */
public class IPlayingState extends IState {
    public IPlayingState(IPlayer iPlayer) {
        super(iPlayer);
        iPlayer.setPlaying(true);
    }

    @Override
    protected void onPlay() {
        super.iPlayer.changeState(new IReadyState(iPlayer));
    }

    @Override
    protected void onLocked() {
        super.iPlayer.changeState(new ILockState(iPlayer));
    }

    @Override
    protected void next() {
        iPlayer.next();
    }

    @Override
    protected void previous() {
        iPlayer.previous();
    }
}
